package com.edu.medicalpro.activity;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;

import com.edu.medicalpro.R;
import com.edu.medicalpro.RecyclerViewadapter.MyAdapter;
import com.edu.medicalpro.bean.DoctorData;
import com.edu.medicalpro.bean.PatientResult;
import com.edu.medicalpro.bean.User;
import com.edu.medicalpro.mvp.HomeContrace;
import com.edu.medicalpro.mvp.presenter.HomePresenter;

import java.util.List;

public class ZhuanJiaInfoActivity extends AppCompatActivity implements HomeContrace.IView  {
    MyAdapter myAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_zhuan_jia_info);
        //绑定recyclerView
        RecyclerView recyclerView=findViewById(R.id.receive_view);
        //创建RecyclerViewAdapter
        //RecyclerViewAdapter adapter=new RecyclerViewAdapter(requireActivity());
        LinearLayoutManager llg=new LinearLayoutManager(this);
        llg.setOrientation(LinearLayoutManager.VERTICAL);
        recyclerView.setLayoutManager(llg);
        myAdapter = new MyAdapter(this);
        HomePresenter doctorPresenter= new  HomePresenter(this);
        doctorPresenter.getDoctor(1,5);
        recyclerView.setAdapter(myAdapter);
    }

    @Override
    public void loginResult(User user) {

    }

    @Override
    public void LoginError(Throwable throwable) {

    }

    @Override
    public void Result(PatientResult user) {

    }

    @Override
    public void DoctorResult(DoctorData doctor) {
        List<DoctorData.DataBean.ListBean> list = doctor.getData().getList();
        myAdapter.setDataList(list);
    }
}